<!-- 悬浮按钮 -->
<template>
	<view class="side-btn" @click="add">
		<text>{{text}}</text>
	</view>
</template>
<script>
	export default {
		props: {
			text: {
				type: String,
				default: '悬赏发布'
			},
			from: {
				type: String,
				default: ''
			}
		},
		methods: {
			add() {
				let that = this;
				uni.navigateTo({
					url: `/subpages/task/add/add?from=${this.from}`,
					events: {
						acceptDataFromOpenedPage(res) {
							that.$emit('update');
						}
					}
				})
			}
		}
	}
</script>
<style scoped lang="scss">
	@import '@/common/css/base.scss';
	.side-btn {
		@include flex(row, center);
		position: fixed;
		right: 10rpx;
		bottom: 110rpx;
		z-index: 2;
		width: 96rpx;
		height: 96rpx;
		background: $color;
		box-shadow: 0 0 15rpx 0 rgba(0, 0, 0, 0.25);
		border-radius: 50%;
		font-size: 26rpx;
		color: #fff;
		text {
			width: 52rpx;
		}
	}
</style>
